<template>
    <div class="left-wrap">
        <div class="tip">
            <router-link class = "router_link" to="" ><img src="https://images.mafengwo.net/images/safety-prevention/index-link-v2.png" alt=""></router-link>
        </div>
        <div class="block">
            <!-- 轮播图区域 -->
            <div class = "slid_box">
                <div class = "title">
                    <h3>旅行攻略专栏</h3>
                    <router-link class = "skip" to = "">专栏首页</router-link>
                </div>
                <!-- 给轮播图添加导航按钮 -->
                <ul class = "swiper_btn">       
                    <li v-for = "(item, index) of 5" :key = "index" :class = "{active: active == index}" @click = "controlSwiper(index)"></li>
                </ul>
                <el-carousel ref = "aa" @change = "carousel" height="246px"  class = "show_box" indicator-position = "none">
                    <el-carousel-item class  = "show_item" v-for="(item, i) in list" :key="i">
                       <img :src="item.url" alt=""  @click="swipers(i)">
                        <span class = "title">{{item.title}}</span><br>
                        <span class = "content">{{item.content}}</span>
                        
                    </el-carousel-item>
                </el-carousel>
            </div>
            <!-- 第二个区域 -->
            <div class="content_item_1">
                <div class = "title">
                    <h3>旅游攻略推荐</h3>
                    <router-link class = "skip" to = "/dest">更多</router-link>
                </div>
                <div class = "item_1_content"  >
                    <router-link to = "/dest/detail?id=10"><img src="https://n1-q.mafengwo.net/s13/M00/2F/98/wKgEaVyLS9-AIVVgAAGRmxCXIQI26.jpeg?imageMogr2%2Fthumbnail%2F%21260x139r%2Fgravity%2FCenter%2Fcrop%2F%21260x139%2Fquality%2F100" alt=""></router-link>
                    <router-link class = "title_skip" to = "">
                        3条自驾路线，带你玩转南京周边的村落，草原和花...
                    </router-link>
                </div>
            </div>
            <!-- 第三个区域 -->
            <div class="content_item_2" @click="huodong">
                <div class = "title">
                    <h3>最新活动</h3>
                    <router-link class = "skip" to = "">查看全部</router-link>
                </div>
                <div class = "item_1_content">
                    <router-link to = ""><img src="https://n1-q.mafengwo.net/s18/M00/37/28/CoUBYGDIcK-AQInXAAIee_tFC4s83.jpeg?imageView2%2F2%2Fw%2F260%2Fh%2F178%2Fq%2F90" alt=""></router-link>
                    <router-link class = "title_skip" to = "">
                        潮玩旅行路书
                    </router-link>
                    <p>来定制路书，跟哈弗一起去潮玩！</p>
                </div>
            </div>
        </div>

        <!-- 下面三个区域 -->
        <div class="asideleft">
                <!-- 内层 -->
            <div class="box" >
                <!-- 上部分 -->
                <div class="box-hd">
                    <h2 class="hd-right">未知旅行实验室</h2>
                    <router-link to="" class="hd-left">查看更多&gt;</router-link>
                </div>
                <!-- 图片 -->
                <div class="box-img" @click="$router.push('/load')">
                    <router-link to="" class="hd-bottom">
                        <img src="https://images.mafengwo.net/images/new-index/unknownTravel181120.png" alt="">
                    </router-link>
                </div>
            </div>
            <div class="box" @click="$router.push('/Mycenter')">
                <div class="box-hd">
                    <h2 class="hd-right">加入毕业旅游</h2>
                    <router-link to="#" class="hd-left">了解详情&gt;</router-link>
                </div>
                <!-- 图片 -->
                <div class="box-img">
                    <router-link to="" class="hd-bottom">
                        <img src="https://b1-q.mafengwo.net/s14/M00/01/D0/wKgE2l1t1WqAOUvnAACxwvHwMhM32.jpeg" alt="" >
                    </router-link>
                </div>
            </div>
            <!-- 最下边文字 -->
            <div class="news">
                <h2>
                <router-link to="" class="text">毕业旅游网最新资讯</router-link>
                </h2>
                <ul class="aside-bd">
                    <li v-for="(item,i) in newslist" :key = "i" >{{item.data}} 
                        <router-link to="" class="router-link">{{item.titlehd}}</router-link>
                    </li>

                </ul>
            </div>
        </div>
    </div>
</template>

<script>

export default {
  
    name: 'WorkspaceJsonMainleft',

    data() {
        return {
            list: [
                {
                    "url": "https://b3-q.mafengwo.net/s13/M00/71/D6/wKgEaVyd7i6AFjCjAADni5x-vvY89.jpeg",
                    "title": "夏木尼，小王子的玫瑰城市",
                    "content": "夏木尼（Chamounix）是法国勃朗峰脚下最著名的小城，《小王子》里的玫瑰城市，世界登山运动的发源地。"
                },
                {
                    "url": "https://n2-q.mafengwo.net/s13/M00/72/B9/wKgEaVyd7ryAdEkeAADZPC_YEuI86.jpeg",
                    "title": "暹粒油淋鱼",
                    "content": "默默等待，鱼上桌，迅速夹一口塞在嘴里——我就像个戒烟多日的老烟枪终于抽上了烟，心里的空洞瞬间被填满了。"
                },
                {
                    "url": "https://n4-q.mafengwo.net/s13/M00/74/67/wKgEaVyd79SAD6lVAAC7rgrAj0E79.jpeg",
                    "title": "西安：旧长安的画皮",
                    "content": "西安这座曾经的13朝古都，在今天更像旧长安的画皮，城墙完整绵延，一切就像一张唐画的影印本。"
                },
                {
                    "url": "https://n1-q.mafengwo.net/s13/M00/FB/B9/wKgEaVycpr6Ae-TXAAC_Ffkpk0s50.jpeg",
                    "title": "漫山岛",
                    "content": "漫山岛在第二条路上，满眼都是天赋，却偏爱挥霍青山绿水，用自己的方式过小日子，即便强行拖它起来，也得不到结果。"
                },
                {
                    "url": "https://n3-q.mafengwo.net/s13/M00/FD/07/wKgEaVycp3-AVimPAADWiqvk6ek72.jpeg",
                    "title": "胡日尔镇的美术馆",
                    "content": "我最终从胡日尔的美术馆里带走了一幅画，画的是冬日的萨满岩，是日落时分。"
                }

            ],
            active: "",
            newslist:[
                {   
                    "id":1,
                    "data":"04月07日",
                    "titlehd":'毕业旅游"云旅游"直播的攻与守',
                },
                 {   
                    "id":2,
                    "data":"04月01日",
                    "titlehd":'毕业旅游的"云上战役"',
                },
                 {   
                    "id":3,
                    "data":"02月13日",
                    "titlehd":'科技"战役":毕业旅游大数据赋能旅游业',
                },
                {   
                    "id":4,
                    "data":"02月19日",
                    "titlehd":'陈罡:疫情下旅游业的"守恒与求变"',
                },
                {   
                    "id":5,
                    "data":"02月06日",
                    "titlehd":'毕业旅游将退订完成率定为最高KPI',
                },
                {   
                    "id":6,
                    "data":"09月28日",
                    "titlehd":'毕业旅游国庆白领出游偏好调查: 超7...',
                }]
        };
    },

    mounted() {
        
    },

    methods: {
        carousel(e) {
            this.active = e;
        },
        controlSwiper(index) {
            this.$refs.aa.setActiveItem(index);
        },
        swipers(i){
            let mid = Number(i+50)
            this.$router.push('/community?mid='+mid)
        },
        huodong(){
            this.$message({
                type:'warning',
                message:'该活动尚未开启，敬请期待！'
            })
        }
    },
   
};
</script>
 
<style lang="scss" scoped>
.left-wrap{
    width: 280px;
    min-height: 600px;
    
    div {
        
        .router_link {
            display: inline-block;
            width: 280px;
            height: 30px;
            img {
                width: 100%;
            }
        }
    }
    .block {            //轮播图部分
        margin-top: 35px;
        position: relative;
        .show_box {
            .show_item {
                img {
                    width: 100%;
                }
                .title {
                    display: inline-block;
                    margin: 5px 0;
                }
                .content {
                    font-size: 14px;
                    color: #666666; 
                } 
            }
            .el-carousel__item:nth-child(n) {
                background-color: transparent;
            } 
        }
        .swiper_btn {           //轮播图按钮
            position: absolute;
            left: 85px;
            top: 169px;
            list-style: none;
            margin: 0;
            padding: 0;
            z-index: 100;
            li {
            list-style: none;
                float: left;
                width: 16px;
                height: 16px;
                // border: 1px solid white;
                border-radius: 8px;
                background-color: rgba(65, 193, 236, 0.2);
                margin-left: 5px;
                cursor: pointer;
            }
            .active {
                background-color: #41c1ec;

            }
        }
        .title {
            display: flex;
            justify-content: space-between;
            margin-bottom: 20px;
            h3 {
                font-weight: 500;
                color: #333333;
                font-size: 18px;

            }
            .skip {
                margin-top: 3px;
                font-size: 12px;
                color: #999999;
                text-decoration: none;
                &:hover {
                    text-decoration: underline;
                }
            }
        }
        .content_item_1 {
            margin-top: 30px;
            img {
                width: 100%;
                margin-bottom: 10px;

            }
            .title_skip {
                display: inline-block;
                width: 280px;
                font-size: 16px;
                color: #333333;
                text-decoration: none;
                white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
                &:hover {
                    color: #41c1ec;
                    text-decoration: underline;
                }
            }

        }
        .content_item_2 {
            margin-top: 30px;
            margin-bottom: 30px;
            img {
                width: 100%;
                margin-bottom: 10px;
            }
            .title_skip {
                display: inline-block;
                width: 280px;
                font-size: 16px;
                color: #333333;
                text-decoration: none;
                white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
                &:hover {
                    color: #41c1ec;
                    text-decoration: underline;
                }
            }
            p {
                font-size: 14px;
                color: #999999;

            }

        }
    }
    .box{                  // 下面三个区域样式
      width: 280px;
      height: 217px;
      padding-bottom: 20px;
      margin:0 auto;
      .box-hd{
          height: 35px;
          display: flex;
          justify-content: space-between;
          margin-bottom: 12px;
       .hd-right{
           font-size: 18px;
           line-height: 35px;
           font-weight: normal;
           color: #333333;
           margin: 0;
       }
       .hd-left{
           display: block;
           line-height: 35px;
           font-size: 12px;
           color: #666666;
           text-decoration: none;
       }
       .hd-left:hover{
           text-decoration: underline;
       }
      }
      .box-img {
            width: 100%;
            img {
                width: 100%;
            }
        }
   }
   .news{
      width: 280px;
      height: 227px;
      margin:0 auto;
       h2{
          font-size: 18px;
          font-weight: normal;
          height:35px;
          line-height: 35px;
          margin-bottom: 10px;
         .text{
           color: #333;
           text-decoration: none;
          }
        }
       .aside-bd{
            list-style: none;
            width: 280px;
            font-size: 12px;
            li{
                overflow: hidden;
             .router-link{
                 text-decoration: none;
                 color: #333333;
                 height: 30px;
                 line-height: 30px;
                 
             }
             .router-link:hover{
                  text-decoration: underline;
             }
            }
      }
       
   }
}
</style>